package com.chinacoal.hr.levelapi.client;

import com.chinacoal.hr.levelapi.client.fallback.HolidayLawClientFallback;
import com.chinacoal.hr.levelapi.client.response.Result;
import com.chinacoal.hr.levelapi.entity.HolidayLaws;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * Created by jinyabin on 2020/10/29.
 */
@Api(tags = {"假期排班"})
@FeignClient(name = "ccip-hr-attendance",configuration = FeignAutoConfiguration.class,fallback = HolidayLawClientFallback.class)
public interface HolidayLawClient {

    /**
     * 查询假期排班信息列表
     *
     * @param page  :
     * @param limit :
     * @param year  :
     * @param hdate :
     * @return : com.chinacoal.hr.levelimpl.response.Result
     * @author : YunTao.Li
     * @date : 2019/12/18 2019/12/18
     */
    @ResponseBody
    @GetMapping("/holidaylaws")
    @ApiOperation(value = "查询假期排班信息列表")
    public Result list(@ApiParam("当前页数") long page,
                       @ApiParam("每页条数") long limit,
                       @ApiParam("年份") String year,
                       @ApiParam("日期") String hdate) ;




    /**
     * 新增假期排班信息
     *
     * @param record :
     * @return : com.chinacoal.hr.levelimpl.response.Result
     * @author : YunTao.Li
     * @date : 2019/12/18 2019/12/18
     */
    @PostMapping("/holidaylaw")
    @ApiOperation(value = "新增假期排班信息")
    public Result add(@RequestBody HolidayLaws record) ;



    /**
     * 编辑假期排班信息
     *
     * @param holidayId :
     * @param record    :
     * @return : com.chinacoal.hr.levelimpl.response.Result
     * @author : YunTao.Li
     * @date : 2019/12/18 2019/12/18
     */
    @PutMapping("/holidaylaw/{holidayId}")
    @ApiOperation(value = "编辑假期排班信息")
    public Result update(@PathVariable String holidayId,
                         @RequestBody HolidayLaws record) ;





    /**
     * 删除假期排版信息
     *
     * @param holidayId :
     * @return : com.chinacoal.hr.levelimpl.response.Result
     * @author : YunTao.Li
     * @date : 2019/12/18 2019/12/18
     */
    @DeleteMapping("/holidaylaw/{holidayId}")
    @ApiOperation(value = "删除假期排版信息")
    public Result delete(@PathVariable String holidayId) ;




    /**
     * 时间计算
     *
     * @param startDate     :
     * @param startTimeType :
     * @param endDate       :
     * @param endTimeType   :
     * @return : com.chinacoal.hr.levelimpl.response.Result
     * @author : YunTao.Li
     * @date : 2019/12/27 2019/12/27
     */
    @GetMapping("/date/calc")
    @ApiOperation(value = "天数换算")
    public Result getLawMgr(@ApiParam("开始时间") String startDate,
                            @ApiParam("开始时段") String startTimeType,
                            @ApiParam("结束时间") String endDate,
                            @ApiParam("结束时段") String endTimeType);


}
